package com.engine.cn.sigletom;

import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

/**
 * 静态内部类的方式实现这个单例模式，静态内部类遵循懒加载
 */
public class StaticInnerSingleton {

    private StaticInnerSingleton() {
    }

    private static class SingletonHolder {
        static final StaticInnerSingleton INSTANCE = new StaticInnerSingleton();
    }

    public static StaticInnerSingleton getInstance() {
        return SingletonHolder.INSTANCE;// 只有执行到这里才会加载SingletonHolder
    }

    @Data
    private static class Point {
        BigDecimal longitude;
        BigDecimal latitude;
    }

    /**
     * 是否出电子围栏的判定
     *
     * @param areaFenceList 围栏列表
     * @param point         某人定的点
     * @return 是否出区域
     */
    public static boolean check(List<Point> areaFenceList, Point point) {
        return true;
    }
}
